package com.gitee.springioc.practice.service.impl;

import com.gitee.springioc.practice.entity.Partner;
import com.gitee.springioc.practice.service.PartnerService;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.ArrayList;

/**
 * @author ming.yan-1
 * @version V1.0
 * @Title com.gitee.springioc.practice.service.impl
 * @Description
 * @date 2018/10/9  上午11:13
 */
@Service("partnerServiceImpl")
public class PartnerServiceImpl implements PartnerService {

    @Override
    public ArrayList<Partner> queryAllPartner() {
        ArrayList<Partner> arrayList = new ArrayList<>();
        for(int i = 0;i<10 ;i++){
            Partner partner = new Partner();
            partner.setLimitAmount(BigDecimal.valueOf(i));
            partner.setPartnerName("name"+i);
            partner.setPartnerNo("2018"+i);
//            partner.setRsaKey(UUID.randomUUID().toString());
            arrayList.add(partner);
        }
        return arrayList;
    }

    @Override
    public Partner queryPartner(String partnerNo) {
        Partner partner = new Partner();
        partner.setLimitAmount(BigDecimal.valueOf(100));
        partner.setPartnerName("name"+partnerNo);
        partner.setPartnerNo(partnerNo);
//        partner.setRsaKey(UUID.randomUUID().toString());
        return partner;
    }
}
